package org.rslai.util.email;

import java.util.Properties;
import javax.mail.Folder;

public class IMAPinfo {
	private String protocol = "imap"; // 服务器协议
	private String mailServerHost; // 服务器IP或域名
	private String userName; // 用户名
	private String password; // 密码
	private String folder = "INBOX"; // 收取文件夹，默认"INBOX"
	private int folderReadWriteMode= Folder.READ_WRITE; // 文件夹读写模式，默认 Folder.READ_WRITE

	/**
	 * 获得邮件会话属性
	 */
	public Properties getProperties() {
		Properties p = new Properties();
		p.setProperty("mail.store.protocol", this.getProtocol());
		p.setProperty("mail.imap.host", this.getMailServerHost());

		return p;
	}

	public String getMailServerHost() {
		return mailServerHost;
	}

	public void setMailServerHost(String mailServerHost) {
		this.mailServerHost = mailServerHost;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public String getFolder() {
		return folder;
	}

	public void setFolder(String folder) {
		this.folder = folder;
	}

	public int getFolderReadWriteMode() {
		return folderReadWriteMode;
	}

	public void setFolderReadWriteMode(int folderReadWriteMode) {
		this.folderReadWriteMode = folderReadWriteMode;
	}

}
